let app = getApp();
import Toast from '../../../components/vant/toast/toast';
Page({
	data: {
		phone: "",
		isCorrect: false,
		statusHeight: app.globalData.window.statusHeight || 1,
		navheight: app.globalData.window.navheight || 1,
	},
	changeData(e) {
		const mobileReg = /^(13[0-9]|14[56789]|15[0-3,5-9]|16[67]|17[1235678]|18[0-9]|19[135689])\d{8}$/;
		this.setData({
			phone: e.detail.value,
			isCorrect: mobileReg.test(e.detail.value)
		})

	},
	submitBind() {
		if (!this.data.isCorrect) {
			Toast('请输入正确手机号')
			return false;
		}
		wx.navigateTo({ url: `/pages/bindPhone/code/index?phone=${this.data.phone}` })
	},
})
